package book_manage_system.book;

import book_manage_system.book.Book;

public class BookList {
    private Book[] books = new Book[10];
    private int usedSize; //记录当前books中有多少本书

    public BookList(){ //构造器 初始化图书信息
        books[0] = new Book("三国演义","罗贯中",89.1,"小说");
        books[1] = new Book("西游记","吴承恩",78.1,"小说");
        books[2] = new Book("红楼梦","曹雪芹",50,"小说");
        usedSize = 3;
    }
    public Book getBooks(int size){
        return this.books[size];
    }
    public void setBooks(Book book){
        books[usedSize] = book;
    }
    public Book[] getBooks() {
        return books;
    }
    public void setBooks(int pos, Book book){
        books[pos] = book;
    }

    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }
}
